package com.quectel.taskserver.job;

import org.apache.shardingsphere.elasticjob.api.ShardingContext;
import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.List;

@Component
public class SpringBootDataflowJob implements DataflowJob<String> {
    @Override
    public List<String> fetchData(ShardingContext shardingContext) {
        return Arrays.asList("index:" + shardingContext.getShardingItem() + "parameter:" + shardingContext.getShardingParameter());
    }

    @Override
    public void processData(ShardingContext shardingContext, List<String> list) {
        System.out.println(list);
    }
}
